package club.beimeng.properties;

import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;

public class AccountProp {

    private Properties emailProperties;

    {
        emailProperties = new Properties();
        InputStream res = this.getClass().getResourceAsStream("/accounts.properties"); // 根目录下读取文件
        try {
            emailProperties.load(res);
        } catch (IOException e) {
            System.out.println("根目录下文件读取失败");
            e.printStackTrace();
        }
    }

    // 实现几个功能
    //1 获取所有账号
    public List<Account> getAccounts(){
        ArrayList<Account> accounts = new ArrayList<>();
        Account account = new Account();
        emailProperties.forEach( (key,val)->{
            account.setAccountId((String) key);
            String val1 = (String) val;
            String[] split = val1.split("&");


        });
        return null;
    }

    //2 禁用某个账号 并 保存某个账号
}
